package com.fortune.dao;

import com.fortune.dto.in.cOrderMgt.*;
import com.fortune.dto.in.clientRepayment.ClientRepaymentConfirm;
import com.fortune.dto.in.clientRepayment.ClientRepaymentDetails;
import com.fortune.dto.in.clientRepayment.ClientRepaymentList;
import com.fortune.vo.cOrderMgt.*;
import com.fortune.vo.clientRepayment.ClientRepaymentDetailsVo;
import com.fortune.vo.clientRepayment.ClientRepaymentVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface COrderBaseDao {
    /**
     * 查询客户订单列表
     * @param dealerId
     * @param listDto
     * @return
     */
    List<COrder> queryOrderBaseList(@Param("dealerId") String dealerId, @Param("listDto") COrderListDto listDto);

    /**
     * 查询客户订单列表个数
     * @param dealerId
     * @param listDto
     * @return
     */
    int queryOrderBaseListCount(@Param("dealerId") String dealerId, @Param("listDto") COrderListDto listDto);

    /**
     * 添加客户订单
     * @param id
     * @param dealerId
     * @param addDto
     * @return
     */
    int addOrderBase(@Param("id") String id, @Param("dealerId") String dealerId, @Param("addDto") COrderAddDto addDto);

    /**
     * 添加客户订单详情
     * @param clientId
     * @param id
     * @param dealerId
     * @param list
     * @return
     */
    int addOrderBaseDetails(@Param("clientId") String clientId, @Param("id") String id, @Param("dealerId") String dealerId, @Param("list") List<COrderProduceDto> list);

    /**
     * 编辑客户订单
     * @param dealerId
     * @param editDto
     * @return
     */
    int editOrderBase(@Param("dealerId") String dealerId,@Param("editDto") COrderEditDto editDto);

    /**
     * 删除客户订单详情
     * @param dealerId
     * @param id
     * @param ordersId
     * @return
     */
    int deleteOrderBase(@Param("dealerId") String dealerId,@Param("id") String id,@Param("ordersId") String ordersId);

    /**
     * 删除客户订单
     * @param dealerId
     * @param orderId
     * @param clientId
     * @return
     */
    int deleteOrder(@Param("dealerId") String dealerId, @Param("orderId") String orderId, @Param("clientId") String clientId);

    /**
     * 批准发货
     * @param dealerId
     * @param userId
     * @param cOrderApproveDto
     * @return
     */
    int updateApproved(@Param("dealerId") String dealerId, @Param("userId") String userId, @Param("cOrderApproveDto") COrderApproveDto cOrderApproveDto);

    /**
     * 详情
     * @param dealerId
     * @param orderId
     * @param clientId
     * @return
     */
    COrderDetails queryDetails(@Param("dealerId") String dealerId, @Param("orderId") String orderId, @Param("clientId") String clientId);

    /**
     * 查询经销商司机
     * @param dealerId
     * @param driverId
     * @return
     */
    List<COrderDriver> queryDriverList(@Param("dealerId") String dealerId, @Param("driverId") String driverId);

    /**
     * 开单人信息
     * @param dealerId
     * @param userId
     * @return
     */
    COrderBiller queryBiller(@Param("dealerId") String dealerId, @Param("userId") String userId);

    /**
     *
     * @param dealerId
     * @param listDto
     * @return
     */
    List<ClientRepaymentVo> queryClientRepaymentList(@Param("dealerId") String dealerId, @Param("listDto") ClientRepaymentList listDto);

    /**
     *
     * @param dealerId
     * @param listDto
     * @return
     */
    int queryClientRepaymentListCount(@Param("dealerId") String dealerId, @Param("listDto") ClientRepaymentList listDto);

    /**
     *
     * @param dealerId
     * @param clientRepaymentConfirm
     * @return
     */
    int clientRepaymentConfirm(@Param("userId") String userId,@Param("dealerId") String dealerId, @Param("clientRepaymentConfirm") ClientRepaymentConfirm clientRepaymentConfirm);

    /**
     *
     * @param dealerId
     * @param list
     * @return
     */
    int clientRepaymentPiConfirm(@Param("userId") String userId,@Param("dealerId") String dealerId, @Param("list") List<ClientRepaymentConfirm> list);

    /**
     *
     * @param dealerId
     * @param details
     * @return
     */
    ClientRepaymentDetailsVo queryClientRepaymentDetails(@Param("dealerId") String dealerId, @Param("details") ClientRepaymentDetails details);

    /**
     * 客户订单
     * @param dealerId
     * @param clientId
     * @param orderId
     * @return
     */
    COrderBaseInfo queryOrderBaseInfo(@Param("dealerId") String dealerId, @Param("clientId") String clientId,@Param("orderId") String orderId);

    /**
     *
     * @param cOrderApproveDto
     * @param orderBaseInfo
     * @param orderBaseInfo
     * @return
     */
    int addOrderBaseInfo(@Param("userId") String userId,@Param("id") String id,@Param("cOrderApproveDto") COrderApproveDto cOrderApproveDto,@Param("orderBaseInfo") COrderBaseInfo orderBaseInfo,@Param("endNum") String endNum);

    Integer queryDOutBaseInfoNo(String dealerId);

    int addOrderBaseDetail(@Param("id") String id,@Param("list") List<CCorderPriduce> list);
}
